package com.pasabahceambalaj.entity;

// Generated Oct 8, 2013 12:01:41 AM by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * Urun generated by hbm2java
 */
@Entity
@Table(name = "urun", catalog = "ambalaj", uniqueConstraints = { @UniqueConstraint(columnNames = { "pfirmaid", "urunno" }), @UniqueConstraint(columnNames = "urunno") })
public class Urun implements java.io.Serializable {

	private Long id;
	private int version;
	private Kalip kalip;
	private Firma firma;
	private String urunno;
	private String adi;
	private String ambalaj;
	private String barkod;
	private String upc;
	private String paletadedi;

	public Urun() {
	}

	public Urun(Kalip kalip, Firma firma, String urunno, String adi) {
		this.kalip = kalip;
		this.firma = firma;
		this.urunno = urunno;
		this.adi = adi;
	}

	public Urun(Kalip kalip, Firma firma, String urunno, String adi, String ambalaj, String barkod, String upc, String paletadedi) {
		this.kalip = kalip;
		this.firma = firma;
		this.urunno = urunno;
		this.adi = adi;
		this.ambalaj = ambalaj;
		this.barkod = barkod;
		this.upc = upc;
		this.paletadedi = paletadedi;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public int getVersion() {
		return this.version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "kalipid", nullable = false)
	@NotNull
	public Kalip getKalip() {
		return this.kalip;
	}

	public void setKalip(Kalip kalip) {
		this.kalip = kalip;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pfirmaid", nullable = false)
	@NotNull
	public Firma getFirma() {
		return this.firma;
	}

	public void setFirma(Firma firma) {
		this.firma = firma;
	}

	@Column(name = "urunno", unique = true, nullable = false)
	@NotNull
	public String getUrunno() {
		return this.urunno;
	}

	public void setUrunno(String urunno) {
		this.urunno = urunno;
	}

	@Column(name = "adi", nullable = false, length = 1000)
	@NotNull
	@Length(max = 1000)
	public String getAdi() {
		return this.adi;
	}

	public void setAdi(String adi) {
		this.adi = adi;
	}

	@Column(name = "ambalaj", length = 1000)
	@Length(max = 1000)
	public String getAmbalaj() {
		return this.ambalaj;
	}

	public void setAmbalaj(String ambalaj) {
		this.ambalaj = ambalaj;
	}

	@Column(name = "barkod")
	public String getBarkod() {
		return this.barkod;
	}

	public void setBarkod(String barkod) {
		this.barkod = barkod;
	}

	@Column(name = "upc")
	public String getUpc() {
		return this.upc;
	}

	public void setUpc(String upc) {
		this.upc = upc;
	}

	@Column(name = "paletadedi")
	public String getPaletadedi() {
		return this.paletadedi;
	}

	public void setPaletadedi(String paletadedi) {
		this.paletadedi = paletadedi;
	}
}
